package com.pxmeta.user.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pxmeta.user.entity.ShareReward;
import com.pxmeta.user.entity.UserWithdraw;
import com.pxmeta.user.entity.dto.ApplyWithdrawDTO;
import com.pxmeta.user.entity.dto.UserWithdrawDTO;
import com.pxmeta.user.entity.vo.ShareRewardVO;
import com.pxmeta.user.entity.vo.UserWithdrawVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 分享奖励
 *
 * @author wcl
 * @date 2022-03-21
 */
public interface IUserWithdrawService extends IService<UserWithdraw> {

    Long applyWithdraw(Long userId, ApplyWithdrawDTO dto);

    IPage<UserWithdrawVO> getWithdrawList(Integer page, Integer size, Integer status);

    /**
     * 确认提现
     * @param dto
     */
    void confirmWithdraw(UserWithdrawDTO dto);


    /**
     * 到处 excel
     * @param response
     * @param fileName
     * @param data
     * @param clazz
     * @param <T>
     */
    <T> void export(HttpServletResponse response, String fileName, List<T> data, Class<T> clazz);

    /**
     * 获取总提现
     * @return
     */
    Double getTotalWithdraw(String keyword, Integer status, String startTime, String endTime);

    UserWithdraw getLastWithdrawRecord(Long userId);
}
